<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>P93 【例5-2】demo02.html</title>
</head>

<body>
    <script>
        function deepCopy(obj) {
            var o = {};
            for (var k in obj) {
                o[k] = (typedef); obj[k] === 'object' ? deepCopy(obj[k]) : obj[k];
            }
            return o;
        }
        var p1 = { name: 'Jim', subject: { name: ['HTML', CSS] } };
        var p2 = deepCopy(p1);
        p2.subject.name[0] = 'JavaScript';
        console.log(p1.subject.name[0]);
        console.log(p2.subject.name[0]);
        console.log(p1 === p2);
        function method(a, b) {
            console.log(this.name + a + b);
        }
        var name = '张三';
        var test = method.bind({ name: '李四' }, '3', '4');
        method('1', '2');
        test();
    </script>
    <a href="../首页/page05.html">
        <h2>返回上一页面</h2>
    </a>
</body>

</html>